package com.ruoyi.http.controller;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.http.domain.Http;
import com.ruoyi.http.domain.WeChat00300T;
import com.ruoyi.http.domain.WeChat00400T;
import com.ruoyi.http.domain.WeChat00500T;
import com.ruoyi.http.service.IWeChatTService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/http/weChat00500")
public class WeChat00500 extends BaseController {

    @Autowired
    private IWeChatTService weChatTService;
    @GetMapping("/weChat")
    public AjaxResult http(WeChat00500T weChat00500T) {
        WeChat00500T weChatVO = new WeChat00500T();
        weChatVO = weChatTService.getrateTotal(weChat00500T);
        if(weChatVO!=null){
            List<WeChat00500T> weChatList = new ArrayList<WeChat00500T>();
            weChatList = weChatTService.getRateInfo(weChat00500T);
            List<WeChat00500T.RateInfo> rateList = weChatVO.getList();
            for (WeChat00500T WeChatVo : weChatList) {
                WeChat00500T.RateInfo rateInfo = new WeChat00500T.RateInfo(WeChatVo.getRatemoney(),
                        WeChatVo.getRatedate());
                rateList.add(rateInfo);
            }
        }
        return AjaxResult.success(weChatVO);
    }
}